package com.server.rule.data.loader;

import com.shared.data.IData;
import com.shared.data.TypeIData;;

public class InformationLoaderFactory {
	
	private static InformationLoaderFactory instance = new InformationLoaderFactory();
	
	private InformationLoaderFactory(){}
	
	public final synchronized static  InformationLoaderFactory get() {
		return instance;
	}
	
	public InformationLoader getInformationLoader(TypeIData type,IData object){
		switch (type) {
		case ASSURE:
			return new AssureInformationLoader(object);
		default:
			return new InformationLoader(object);
		}		
		
	}
	
	public InformationLoader getInformationLoader(TypeIData type){
		switch (type) {
		case ASSURE:
			return new AssureInformationLoader();
		default:
			throw new IllegalArgumentException("Ce type de données ne peut etre traitée");
		}	
	}

}
